package me.yushuai.wukong.base.controller;

import me.yushuai.wukong.base.api.ActionLogApi;
import me.yushuai.wukong.base.api.vo.ActionLogVo;
import me.yushuai.wukong.base.entity.ActionLogInfo;
import me.yushuai.wukong.base.service.ActionLogService;
import me.yushuai.wukong.common.dto.PageDTO;
import me.yushuai.wukong.common.exceptin.NotExistException;
import me.yushuai.wukong.common.mvc.RestRequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhoushuai@189.cn
 * @since 2023-09-19
 */
@RestController
@RestRequestMapping
public class ActionLogController implements ActionLogApi {

    @Autowired
    private ActionLogService actionLogService;

    /**
     * 分页查询操作日志信息
     *
     * @return 返回操作日志列表
     */
    @Override
    @GetMapping("/logs")
    public PageDTO<ActionLogVo> pagingSearch() {

        return null;
    }


    /**
     * 查询操作日志记录
     *
     * @param id 操作日志Id
     * @return 返回操作日志的详细信息
     */
    @Override
    @GetMapping("/log/{id}")
    public ActionLogVo getActionLogById(@PathVariable("id") Long id) throws NotExistException {
        final ActionLogInfo actionLogInfo = this.actionLogService.findById(id)
                .orElseThrow(() -> new NotExistException(id, "ActionLogInfo"));
        return null;
    }

}
